import { useState } from "react";

export function Button({ clickNum, onClick }) {
  return (
    <>
      <button onClick={onClick}>点击我{clickNum}</button>
    </>
  );
}

export function Text() {
  const str = "申某人";

  return (
    <>
      <p>{str}</p>
    </>
  );
}

export function List() {
  const products = [
    { title: "Cabbage", id: 1 },
    { title: "Garlic", id: 2 },
    { title: "Apple", id: 3 },
  ];

  const listItems = products.map((product) => (
    <li key={product.id}>{product.title}</li>
  ));

  return <ul>{listItems}</ul>;
}
